/**
 * 
 */

package basic;

import javax.servlet.http.HttpSessionAttributeListener;
import javax.servlet.http.HttpSessionBindingEvent;

import com.e885.log.E885Logger;

/**
 * @author Eric.Kao(gau168.gau@msa.hinet.net)
 * @version 1.0
 * @company E885 Group
 * @copyright Copyright (c) 2001-2008
 */

public class BasicSessionAttributeListener implements HttpSessionAttributeListener
{

	/**
	 * 若 session 加入新的屬性, 則通知正在收聽的物件<br>
	 * getName(): 取得新增屬性的名稱<br>
	 * getValue(): 取得新增的初始值
	 * 
	 * @see javax.servlet.http.HttpSessionAttributeListener#attributeAdded(javax.servlet.http.HttpSessionBindingEvent)
	 */
	public void attributeAdded( HttpSessionBindingEvent event )
	{
		E885Logger.testLog.debug( "*** start to execute method attributeAdded() ***" );
		
		E885Logger.testLog.debug( "name:" + event.getName() );
		E885Logger.testLog.debug( "value:" + event.getValue() );
		
		E885Logger.testLog.debug( "*** end to execute method attributeAdded() ***" );
	}

	/**
	 * 若 session 中某個屬性的屬性值被取代, 則通知正在收聽的物件<br>
	 * getValue(): 傳回屬性最後設定的值
	 * 
	 * @see javax.servlet.http.HttpSessionAttributeListener#attributeRemoved(javax.servlet.http.HttpSessionBindingEvent)
	 */
	public void attributeRemoved( HttpSessionBindingEvent event )
	{
		E885Logger.testLog.debug( "*** start to execute method attributeRemoved() ***" );
		
		E885Logger.testLog.debug( "name:" + event.getName() );
		E885Logger.testLog.debug( "value:" + event.getValue() );
		
		E885Logger.testLog.debug( "*** end to execute method attributeRemoved() ***" );
	}

	/**
	 * 若移除 session 的屬性, 則通知正在收聽的物件<br>
	 * getValue():傳回屬性前一個值
	 * 
	 * @see javax.servlet.http.HttpSessionAttributeListener#attributeReplaced(javax.servlet.http.HttpSessionBindingEvent)
	 */
	public void attributeReplaced( HttpSessionBindingEvent event )
	{
		E885Logger.testLog.debug( "*** start to execute method attributeReplaced() ***" );
		
		E885Logger.testLog.debug( "name:" + event.getName() );
		E885Logger.testLog.debug( "value:" + event.getValue() );
		
		E885Logger.testLog.debug( "*** end to execute method attributeReplaced() ***" );
	}

}
